<template>
	<view class="search-box">
		<view class="inp">
			<u-input v-model="content" prefixIcon="search" :placeholder="placeholder" :clearable="true" border="none" :prefixIconStyle="prefixIconStyle" />
			<view class="btn" @click="onSearch">查询</view>
		</view>
	</view>
</template>

<script>
export default {
	data() {
		return {
			content: ''
		};
	},
	props: {
		placeholder: {
			type: String,
			default: '请输入'
		}
	},
	methods: {
		onSearch() {
			const s = this.content;
			this.$emit('search', s);
		}
	}
};
</script>

<style lang="scss" scoped>
.search-box {
	padding: 10rpx 20rpx;
	background-color: $color-white;

	.inp {
		display: flex;
		background-color: white;
		border-radius: 10rpx;
		overflow: hidden;
		padding-left: 20rpx;

		.btn {
			padding: 5rpx 30rpx;
			background-color: $color-primary;
			color: $color-white;
		}
	}
}
</style>
